package problems;

import lib.MathLib;

public class Euler030 extends AbstractEuler {

	@Override
	public Number calculate() {
		int sumOfFunnyNumbers = 0;
		
		for (int i = 10; i <= 200000; i++) {

			int sumOfFifthPowers = MathLib.sumOfDigitsRaisedToPower(i, 5);
			if (sumOfFifthPowers == i) {
				sumOfFunnyNumbers += i;
			}
		}
		
		return sumOfFunnyNumbers;
	}


	
	@Override
	protected Number getCorrectAnswer() {
		return 443839;
	}

}
